import Vue from 'vue'
import Window from '@/components/windows/window.vue'

const WindowBox = Vue.extend(Window)
let instance = {}
WindowBox.open = function (title, text, option, callback) {
  debugger;
  let options = option || {
    show: false,
    title: "弹层提示",
    width: "50%",
    type: "HTML",
    value: {}
  };
  options['value'] = text;
  options['title'] = title;

  instance = new WindowBox({
    data: options,
  }).$mount();

  document.body.appendChild(instance.$el)

  Vue.nextTick(() => {
    instance.show = true;
    //document.querySelector('body').style.overflow = 'hidden'
  })
}

export default WindowBox
